<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * SimplyPost
 *
 * @author		Pascal Kriete
 * @package		SimplyPost
 * @copyright	Copyright (c) 2008, Pascal Kriete
 * @license 	http://www.gnu.org/licenses/lgpl.txt
 */

// ------------------------------------------------------------------------

/**
 * Administration Controller
 *
 * @package		SimplyPost
 * @subpackage	Admin
 * @category	Controller
 * @author		Pascal Kriete
 */

class Admin extends Administrator {

	/**
	 * Constructor
	 *
	 * @access	public
	 */
	function Admin()
	{
		parent::Administrator();
		$this->lang->load('admin');
	}
	
	// --------------------------------------------------------------------
	
	/**
	 * Shows the main administration page
	 *
	 * @access	public
	 */
	function index()
	{
		set_title($this->lang->line('admin_title'));
		$this->breadcrumb->from_path();
		
		$this->load->view('main');
	}

	// --------------------------------------------------------------------
	
	/**
	 * Sets session data if called via an ajax request
	 *
	 * @access	public
	 */
	function setSessData()
	{
		if (!AJAX)
			show_404();

		$field = $this->input->post('setting');
		$value = $this->input->post('value');
		$this->session->set_userdata($field, $value);
		echo $value;
	}
}